<!-- 添加排课 Modal -->
<div class="modal fade" id="scheduleModal" tabindex="-1" aria-labelledby="scheduleLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg modal-dialog-centered">
        <form id="schedule-form" class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="scheduleLabel"><i class="bi bi-calendar-plus-fill me-2"></i>添加排课</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
            </div>
            <div class="modal-body">
                <div class="row g-3">
                    <div class="col-md-6">
                        <label class="form-label">学生姓名</label>
                        <input name="student_name" type="text" class="form-control" required>
                    </div>
                    <div class="col-md-6">
                        <label class="form-label">课程名</label>
                        <select name="course" id="schedCourse" class="form-select" required>
                            <option value="" disabled selected>请选择课程</option>
                        </select>
                    </div>
                    <div class="col-md-6">
                        <label class="form-label">学校</label>
                        <select name="school" id="schedSchool" class="form-select" required>
                            <option value="" disabled selected>请选择学校</option>
                        </select>
                    </div>
                    <div class="col-md-6">
                        <label class="form-label">年级</label>
                        <select name="grade" id="schedGrade" class="form-select" required>
                            <option value="" disabled selected>请选择年级</option>
                        </select>
                    </div>
                    <div class="col-12">
                        <label class="form-label">上课地点</label>
                        <input name="address" type="text" class="form-control" required>
                    </div>
                    <div class="col-md-4">
                        <label class="form-label">每节学费</label>
                        <input name="fee" type="number" step="0.01" class="form-control" required>
                    </div>
                    <div class="col-md-4">
                        <label class="form-label">排课类型</label>
                        <select name="type" id="schedType" class="form-select" required>
                            <option value="once">一次</option>
                            <option value="weekly">每周</option>
                        </select>
                    </div>
                    <!-- one-time 日期 -->
                    <div class="col-md-4 d-none" id="oneDateGroup">
                        <label class="form-label">选择日期</label>
                        <input name="one_date" type="date" class="form-control">
                    </div>
                    <!-- weekly 相关 -->
                    <div class="col-12 d-none" id="weeklyDays">
                        <label class="form-label">星期</label>
                        <div class="btn-group" role="group">
                            <input type="checkbox" class="btn-check" id="dayMon" value="Mon" autocomplete="off">
                            <label class="btn btn-outline-secondary" for="dayMon">一</label>
                            <input type="checkbox" class="btn-check" id="dayTue" value="Tue" autocomplete="off">
                            <label class="btn btn-outline-secondary" for="dayTue">二</label>
                            <input type="checkbox" class="btn-check" id="dayWed" value="Wed" autocomplete="off">
                            <label class="btn btn-outline-secondary" for="dayWed">三</label>
                            <input type="checkbox" class="btn-check" id="dayThu" value="Thu" autocomplete="off">
                            <label class="btn btn-outline-secondary" for="dayThu">四</label>
                            <input type="checkbox" class="btn-check" id="dayFri" value="Fri" autocomplete="off">
                            <label class="btn btn-outline-secondary" for="dayFri">五</label>
                            <input type="checkbox" class="btn-check" id="daySat" value="Sat" autocomplete="off">
                            <label class="btn btn-outline-secondary" for="daySat">六</label>
                            <input type="checkbox" class="btn-check" id="daySun" value="Sun" autocomplete="off">
                            <label class="btn btn-outline-secondary" for="daySun">日</label>
                        </div>
                    </div>
                    <div class="col-md-4 d-none" id="startDateGroup">
                        <label class="form-label">开始日期</label>
                        <input name="start_date" type="date" class="form-control">
                    </div>
                    <div class="col-md-4 d-none" id="endDateGroup">
                        <label class="form-label">结束日期</label>
                        <input name="end_date" type="date" class="form-control">
                    </div>
                    <div class="col-md-6">
                        <label class="form-label">上课开始时间</label>
                        <input name="start_time" type="time" class="form-control" required>
                    </div>
                    <div class="col-md-6">
                        <label class="form-label">上课结束时间</label>
                        <input name="end_time" type="time" class="form-control" required>
                    </div>
                    <div class="col-12">
                        <label class="form-label">备注</label>
                        <textarea name="remark" class="form-control" rows="2"></textarea>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <span id="scheduleErrorFooter" class="text-danger me-auto" style="display:none;font-size:0.9rem;"></span>
                <button id="schedSubmit" type="submit" class="btn btn-primary">保存</button>
                <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">取消</button>
            </div>
        </form>
    </div>
</div>
